package com.coding.controller;

import com.coding.dto.RestBean;
import com.coding.entity.Message;
import com.coding.service.MessageService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Cynicism
 * @version 1.0
 * @project DyApp
 * @description
 * @date 2024/6/25 11:11:04
 */
@RestController
@RequestMapping("/msg")
//@CrossOrigin
public class MessageController {
    @Resource
    private MessageService messageService;

    @RequestMapping("/getMessage")
    public RestBean<List<Message>> getMessage(@RequestParam Long senderId,@RequestParam Long receiverId,@RequestParam Integer pageNum,@RequestParam Integer pageSize) {
        return messageService.getMessage(senderId, receiverId, pageNum, pageSize);
    }


}
